package com.chixing.service.impl;

import com.chixing.entity.Department;
import com.chixing.mapper.DepartmentMapper;
import com.chixing.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;

    @Override
    public Department getById(Integer deptNo) {
        return departmentMapper.selectById(deptNo);
    }

    @Override
    public boolean save(Department department) {
        int rows = departmentMapper.insert(department);
        return rows > 0;
    }
}
